import http from '../utils/request.js'
// 获取采购订单分页
export function purchaseOrder(data) {
	return http({
		url: `/erp/purchase-order/pageByIn`,data,
		method: 'GET'
	});
};

// 获取BOM单分页
export function getBom(data) {
	return http({
		url: `/erp/bom/page`,data,
		method: 'GET'
	});
};

// 退货入库列表
export function getSaleReturn(data) {
	return http({
		url: `/erp/sale-return/page`,data,
		method: 'GET'
	});
};

// 生产管理详情
export function productionOrderDetail(data) {
	return http({
		url: `/erp/production-order/get`,data,
		method: 'GET'
	});
};

// 详情页面获取需要成品入库的信息
export function getProductionInProductInfo(data) {
	return http({
		url: `/erp/production-in/getProductionInProductInfo`,data,
		method: 'GET'
	});
};

// 详情页面获取领料信息
export function getProductStockInfo(data) {
	return http({
		url: `/erp/production-out/getProductStockInfo`,data,
		method: 'GET'
	});
};



// 选择BOM单号根据id获取bom单详情
export function bomGetDetail(data) {
	return http({
		url: `/erp/bom/getDetail`,data,
		method: 'GET'
	});
};



// 生产单列表
export function getProductionOrder(data) {
	return http({
		url: `/erp/production-order/page`,data,
		method: 'GET'
	});
};

// 获取退料信息
export function getProductionReturnInfo(data) {
	return http({
		url: `/erp/production-out/getProductionReturnInfo`,data,
		method: 'GET'
	});
};



// 退货入库详情
export function getSaleDetail(data) {
	return http({
		url: `/erp/sale-return/get`,data,
		method: 'GET'
	});
};


// 获取采购订单详情
export function getPurchaseOrder(data) {
	return http({
		url: `/erp/stock/get-count`,data,
		method: 'GET'
	});
};

// 获取退货列表
export function getPurchaseReturn(data) {
	return http({
		url: `/erp/purchase-return/page`,data,
		method: 'GET'
	});
};

// 获取供应商列表
export function simpleList(data) {
	return http({
		url: `/erp/supplier/page`,data,
		method: 'GET'
	});
};

// 获取供应商商品分页
export function supplierProduct(data) {
	return http({
		url: `/erp/supplier-product/page`,data,
		method: 'GET'
	});
};

// 获取结算账户列表
export function settlementAccount() {
	return http({
		url: `/erp/account/simple-list`,
		method: 'GET'
	});
};

// 获取采购审核列表
export function getToExamine(data) {
	return http({
		url: `/erp/purchase-in/page`,data,
		method: 'GET'
	});
};

// 更新采购入库的状态
export function updateStatus(id,status) {
	return http({
		url: `/erp/purchase-in/update-status?id=${id}&status=${status}`,
		method: 'PUT'
	});
};

// 创建采购入库
export function createPurchase(data) {
	return http({
		url: '/erp/purchase-in/create',
		method: 'POST',
		data: data
	});
};

// 新增生产单 
export function createByBom(data) {
	return http({
		url: '/erp/production-order/createByBom',
		method: 'POST',
		data: data
	});
};

// 获取仓库货位列表
export function getWarehouse(data) {
	return http({
		url: `/erp/warehouse/page`,data,
		method: 'GET'
	});
};

// 生产领料
export function createProductionOut(data) {
	return http({
		url: '/erp/production-out/create',
		method: 'POST',
		data: data
	});
};

// 新增BOM单
export function createBom(data) {
	return http({
		url: '/erp/bom/create',
		method: 'POST',
		data: data
	});
};

// 原料退回
export function productionReturn(data) {
	return http({
		url: '/erp/production-return/create',
		method: 'POST',
		data: data
	});
};

// 成品入库
export function createProductionIn(data) {
	return http({
		url: '/erp/production-in/create',
		method: 'POST',
		data: data
	});
};

// 扫描NFC
export function scanNfc(data) {
	return http({
		url: '/logistics/logistic-order/scanNfc',
		method: 'POST',
		data: data
	});
};

// 更新配送明细nfc状态
export function updateNfcStatus(id) {
	return http({
		url: `/logistics/logistic-order/updateNfcStatus?id=`+id,
		method: 'PUT'
	});
};

// 获取合单数据
export function getAllCombine(data) {
	return http({
		url: '/erp/combine/getAllCombine',
		method: 'POST',
		data: data
	});
};

// 获取库存数据
export function getProductStockAndBatchInfo(data) {
	return http({
		url: '/erp/combine/getProductStockAndBatchInfo',
		method: 'POST',
		data: data
	});
};

// 获取分类数据
export function getProductCategoryList(data) {
	return http({
		url: '/erp/combine/getProductCategoryList',
		method: 'POST',
		data: data
	});
};

// 合单出库到小车
export function stockOutToCar(data) {
	return http({
		url: '/erp/combine/stockOutToCar',
		method: 'POST',
		data: data
	});
};


// 获取小车数据
export function getCar(data) {
	return http({
		url: '/erp/combine/getCar',
		method: 'POST',
		data: data
	});
};



// 获取订单信息
export function getOrderList(data) {
	return http({
		url: '/erp/combine/getOrderList',
		method: 'POST',
		data: data
	});
};

// 绑定订单货架转运箱
export function binging(data) {
	return http({
		url: '/erp/combine/binging',
		method: 'POST',
		data: data
	});
};

// 小车分拨到转运箱
export function carOutToBox(data) {
	return http({
		url: '/erp/combine/carOutToBox',
		method: 'POST',
		data: data
	});
};

// 验证箱子是否完成
export function verifyBoxFinish() {
	return http({
		url: `/erp/combine/verifyBoxFinish`,
		method: 'GET'
	});
};

// 合单完成，推送物流
export function boxFinish(data) {
	return http({
		url: `/erp/combine/boxFinish`,data,
		method: 'GET'
	});
};

// 转运箱手持出入库。绑定责任人接口
export function outBox(data) {
	return http({
		url: '/erp/stock/logistics/out',
		method: 'POST',
		data: data
	});
};

// 人员下拉框
export function getUser(data) {
	return http({
		url: `/system/user/page`,data,
		method: 'GET'
	});
};

// 根据ID查询转运箱列表
export function listByIds(data) {
	return http({
		url: '/logistics/logistic-box/listByIds',
		method: 'POST',
		data: data
	});
};

// 转运箱批次下拉框接口
export function getBatchNumberGroup(data) {
	return http({
		url: `/erp/stock-batch/getBatchNumberGroup`,data,
		method: 'GET'
	});
};


// 存在固定商品固定批次的库位
export function getExistList(data) {
	return http({
		url: `/erp/warehouse/getExistList`,data,
		method: 'GET'
	});
};

// 转运箱反仓
export function reversePosition(data) {
	return http({
		url: '/logistics/logistic-order/reversePosition',
		method: 'POST',
		data: data
	});
};

// 新增货架数据
export function create(data) {
	return http({
		url: '/logistics/logistic-shelf/create',
		method: 'POST',
		data: data
	});
};

// 删除货架数据
export function deleteHardByBoxId(id) {
	return http({
		url: `/logistics/logistic-shelf/deleteHardByBoxId?boxId=`+id,
		method: 'POST'
	});
};

// 校验货架数据
export function checkLogisticShelf(id) {
	return http({
		url: `/logistics/logistic-shelf/checkLogisticShelf?boxId=`+id,
		method: 'POST'
	});
};

// 更换货架
export function changeShelf(data) {
	return http({
		url: '/erp/combine/changeShelf',
		method: 'POST',
		data: data
	});
};

// 解绑转运箱
export function unBingingBox(data) {
	return http({
		url: '/erp/combine/unBingingBox',
		method: 'POST',
		data: data
	});
};

// 出箱
export function boxToCar(data) {
	return http({
		url: '/erp/combine/boxToCar',
		method: 'POST',
		data: data
	});
};

// 清箱
export function clearBox(data) {
	return http({
		url: '/erp/combine/clearBox',
		method: 'POST',
		data: data
	});
};

// 获取转运箱内商品信息
export function getBoxInfo(boxId) {
	return http({
		url: `/erp/combine/getBoxInfo?boxId=`+boxId,
		method: 'GET'
	});
};

// 关闭订单
export function closeOrder(boxId) {
	return http({
		url: `/erp/combine/closeOrder?orderId=`+boxId,
		method: 'GET'
	});
};

// 开启订单
export function openOrder(boxId) {
	return http({
		url: `/erp/combine/openOrder?orderId=`+boxId,
		method: 'GET'
	});
};

// 获取订单转运箱数据
export function getOrderBoxes(orderId) {
	return http({
		url: `/erp/combine/getOrderBoxes?orderId=`+orderId,
		method: 'GET'
	});
};

// 新增转运箱
export function createBox(data) {
	return http({
		url: '/logistics/logistic-box/create',
		method: 'POST',
		data: data
	});
};

// 转运箱类型下拉列表
export function productSimpleList() {
	return http({
		url: '/logistics/logistic-box/productSimple-list',
		method: 'POST',
	});
};

// 转运箱批次下拉列表
export function getSpuBatchNumbers(id) {
	return http({
		url: '/logistics/logistic-box/getSpuBatchNumbers?skuId='+id,
		method: 'POST',
	});
};

// 获取转运箱详情
export function getLogisticBox(id) {
	return http({
		url: `/logistics/logistic-box/get?id=`+id,
		method: 'GET'
	});
};
